iT邦幫忙

2024 iThome 鐵人賽

DAY 10
0
佛心分享-刷題不只是刷題

CTF 刷題系列 第 10

CTF Day 10 Reverse (GDB baby step 1&2)

  • 分享至 

  • xImage
  •  

今天也來解Reverse的題目

使用到的指令

-info function
-info registers
-disas
-layout
-break

題目 GDB baby step 1

目標找到 main function 末端的 eax register
https://ithelp.ithome.com.tw/upload/images/20240924/201555741ufzdhGAT9.png

main function 在 0x1129 的地方
https://ithelp.ithome.com.tw/upload/images/20240924/20155574GCpdYwNmdc.png

disassemble / disas反組譯指定的程式碼,顯示它對應的組合語言指令
https://ithelp.ithome.com.tw/upload/images/20240924/20155574CAF5ks1aKI.png
https://ithelp.ithome.com.tw/upload/images/20240924/20155574cXJFCYCkjH.png

題目 GDB baby step 2

https://ithelp.ithome.com.tw/upload/images/20240924/20155574AppbgrFK5H.png
info functions
https://ithelp.ithome.com.tw/upload/images/20240924/20155574gGZfEfiCgM.png
disas main
https://ithelp.ithome.com.tw/upload/images/20240924/201555748QwHeJ1VAt.png
首先在main函數處設定斷點
https://ithelp.ithome.com.tw/upload/images/20240924/20155574o07Z6hKLkA.png
layout asm,顯示程式的反組譯程式碼
https://ithelp.ithome.com.tw/upload/images/20240924/20155574GKv8bUSuxS.png
輸入 r(run)
https://ithelp.ithome.com.tw/upload/images/20240924/20155574Ubwskm4J4L.png
設定中斷點在0x401142,輸入break *0x401142
https://ithelp.ithome.com.tw/upload/images/20240924/20155574saDwMudEKK.png
輸入 c(continue)讓code運行
pointer 正指著所需的 address,查 暫存器 (RIP) 的內容
https://ithelp.ithome.com.tw/upload/images/20240924/201555744AgrkiUJv1.png
info registers rip
用來查詢並顯示 RIP 寄存器的當前值
https://ithelp.ithome.com.tw/upload/images/20240924/20155574ofj7jRXpJK.png
檢索 EAX 暫存器的值
輸入 print/d $eax
https://ithelp.ithome.com.tw/upload/images/20240924/20155574XGdhosI4wB.png


上一篇
CTF Day 9 Reverse (asm2)
下一篇
CTF Day 11 Reverse (GDB baby step 3&4)
系列文
CTF 刷題19
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言